import axiosInstance from "@/utils/request";

/**
 * 用户基础信息地址
 */
enum Api {
    BASE_URL = '/user/role',
    ASSIGN_ROLES = `${BASE_URL}/assignRoles/`,
    SET_ROLES = `${BASE_URL}/setRoles`
}

/**
 * 分配职位
 * @param userId 用户id
 */
export const assignRoles = (userId: number) => {
    return axiosInstance({
        url: `${Api.ASSIGN_ROLES}/${userId}`,
        method: 'get',
    })
}

export const setRoles = (data:{}) => {
    return axiosInstance({
        url: Api.SET_ROLES,
        method: 'post',
        data: data
    })
}
